package cn.itsource.controller.app;

import cn.itsource.result.R;
import cn.itsource.service.IOssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 📖：beishan
 * 🗓️：2024/4/5 17:16
 * =====================
 */
@RestController
@RequestMapping("/app/upload")
public class OssController {

    @Autowired
    private IOssService ossService;
    @RequestMapping("/oss")
    public R upload(MultipartFile file, String dir) {
        return R.success(ossService.upload(file,dir));
    }
}
